{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "from SlowFast.slowfast.models import model_builder\n",
    "from slowfast.config.defaults import get_cfg"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "cfg = get_cfg()\n",
    "cfg_file = \"SlowFast/configs/Kinetics/c2/SLOWFAST_8x8_R50.yaml\"\n",
    "cfg.merge_from_file(cfg_file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = model_builder.build_model(cfg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "image = torch.ones([1,3, 8, 256, 256]).to(\"cuda\")\n",
    "image_ = torch.ones([1,3, 32, 256, 256]).to(\"cuda\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "d = \"cuda\" if torch.cuda.is_available() else \"cpu\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[[-2.3687,  0.0744,  1.5987,  ...,  0.1251,  0.9438,  0.0642],\n",
       "         [ 0.3490,  1.9141, -0.0954,  ...,  2.7034, -0.7239,  3.3047],\n",
       "         [ 0.3490,  1.9141, -0.0954,  ...,  2.7034, -0.7239,  3.3047],\n",
       "         ...,\n",
       "         [-1.0207, -2.1259,  2.2472,  ..., -2.9788,  0.4310, -0.2327],\n",
       "         [ 1.0853, -0.0611, -0.4887,  ..., -0.0834,  0.2145, -0.2419],\n",
       "         [ 1.0853, -0.0611, -0.4887,  ..., -0.0834,  0.2145, -0.2419]]],\n",
       "       device='cuda:0', grad_fn=<PermuteBackward>)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a([image, image_])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
